<!--营业概况-->
<template>
  <div>
    <div class="header-right">
      <el-button class="export-btn  float-left" type="primary" round>{{lang._011}}</el-button>
      <!-- 导出按钮 -->
      <el-date-picker class="dataTime float-left" v-model="dataTime" type="datetimerange" :picker-options="pickerOptions2" range-separator="|"
        start-placeholder="2018-3-13 0:00:00" end-placeholder="2018-3-13 24:00:00" align="right">
      </el-date-picker>
      <el-button class="float-left search-btn" type="primary" round>{{lang._012}}</el-button>
      <!-- 时间选择 -->
    </div>
    <el-tabs v-model="activeName2" type="card" @tab-click="handleClick">
      <el-tab-pane :label="lang._002" name="first">
        <el-table class="text-center tables" :data="tableData1" stripe show-summary header-cell-style="color:#409eff">
          <el-table-column prop="categroy" label="" width="120">
          </el-table-column>
          <el-table-column prop="total" :label="lang._013" width="727">
          </el-table-column>
          <el-table-column prop="payment1" :label="lang._014" width="136">
          </el-table-column>
          <el-table-column prop="payment2" :label="lang._015" width="136">
          </el-table-column>
          <el-table-column prop="payment3" :label="lang._016" width="136">
          </el-table-column>
          <el-table-column prop="payment4" :label="lang._017" width="136">
          </el-table-column>
          <el-table-column prop="payment5" :label="lang._018" width="136">
          </el-table-column>
          <el-table-column prop="payment6" :label="lang._019">
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <!-- 营销概况的详情标签页 -->
      <el-tab-pane :label="lang._009" name="second">
        <el-table class="text-center tables" :data="tableData2" stripe header-cell-style="color:#409eff">
          <el-table-column prop="startTime" :label="lang._020" width="180">
          </el-table-column>
          <el-table-column prop="endTime" :label="lang._021" width="200">
          </el-table-column>
          <el-table-column prop="cashier" :label="lang._022" width="101">
          </el-table-column>
          <el-table-column prop="totalAmount" :label="lang._023" width="170">
          </el-table-column>
          <el-table-column prop="payment1" :label="lang._014" width="170">
          </el-table-column>
          <el-table-column prop="payment2" :label="lang._015" width="170">
          </el-table-column>
          <el-table-column prop="payment3" :label="lang._016" width="170">
          </el-table-column>
          <el-table-column prop="payment4" :label="lang._017" width="170">
          </el-table-column>
          <el-table-column prop="payment5" :label="lang._018" width="170">
          </el-table-column>
          <el-table-column prop="payment6" :label="lang._019">
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <!-- 交接班记录的详情标签页 -->
      <el-tab-pane :label="lang._010" name="third">
        <el-table class="text-center tables" :data="tableData3" stripe header-cell-style="color:#409eff">
          <el-table-column prop="operatingTime" :label="lang._024" width="180">
          </el-table-column>
          <el-table-column prop="cashier" :label="lang._022" width="475">
          </el-table-column>
          <el-table-column prop="amount" :label="lang._025" width="347">
          </el-table-column>
          <el-table-column prop="incomeAndExpenses" :label="lang._026" width="347">
          </el-table-column>
          <el-table-column prop="remark" :label="lang._027" >
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <!-- 现金收支明细的详情标签页 -->
    </el-tabs>
  </div>
</template>
<style lang="less" scoped>
  .header-right {
    position: absolute;
    z-index: 2;
    right: 0;
    height: 60px;
    .export-btn {
      margin-top: 15px;
      height: 30px;
      line-height: 30px;
      padding: 0 20px;
      margin-left: 20px;
      margin-right: 20px;
    }
    .search-btn {
      height: 30px;
      line-height: 30px;
      padding: 0 20px;
      margin-top: 15px;
      border-radius: 0 14px 14px 0;
      margin-right: 20px;
    }
    .dataTime {
      border: 1px solid #409eff;
      color: #409eff;
      border-radius: 14px 0 0 14px;
      height: 30px;
      padding: 0;
      margin: 0;
      margin-top: 15px;
      overflow: hidden;
    }

  }

</style>
<style>
.el-table{
  margin: 20px;
}
  .el-tabs__header {
    height: 60px;
    margin: 0;
    background: #FFF;
  }

  .el-tabs__item {
    height: 30px;
    line-height: 30px;
    margin-top: 15px;
    border: none;
    color: #409eff;
    font-size: 15px;
  }

  .el-tabs--card>.el-tabs__header .el-tabs__item {
    border-bottom: none;
    border-left: none;
    margin-left: 20px;
    margin-right: 20px;
  }

  .el-tabs--card>.el-tabs__header .el-tabs__nav {
    border: none;
  }

  .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
    color: #FFF;
    background: #409eff;
    border-radius: 14px;
  }

  .el-tabs__content {
    height: calc(100vh - 61px - 80px);
    background: unset;
  }

  .el-date-editor .el-range-input {
    float: left;
    color: #409eff;
    width: calc(50% - 15px);
  }

  .el-date-editor .el-range-separator {
    float: left;
    color: #409eff;
  }

  .el-date-editor .el-range__icon {
    display: none;
  }

  .el-table th {
    text-align: center !important;
  }

  .el-table th,
  .el-table tr {
    background-color: unset;
  }

  .el-table tr {
    background: #edf5ff;
  }

  .el-table__row {
    background: unset !important;
  }

</style>


<script>
  export default {
    props: ['lang'],
    data() {
      return {
        activeName2: 'first',
        //初始的选择标签页
        pickerOptions2: {
          shortcuts: [{
            text: '最近一周',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit('pick', [start, end]);
            }
          }]
        },
        dataTime: '',
        //时间选择器
        tableData1: [{
          categroy: '商品销售',
          total: '销售额25977.50，利润 190.7 单数11，单均价2361.59，连带率1.36，税费1236.16，服务费1618.61',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          categroy: '储值卡充值',
          total: '充值0，赠送0，单数0',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          categroy: '次卡销售',
          total: '金额0，购买0，退卡0',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          categroy: '购物卡充值',
          total: '充值600.00，赠送60.00',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          categroy: '预付卡销售',
          total: '销售总额0，卡面总额0，销售张数0',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          categroy: '现金收支',
          total: '收入0，支出0',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }],
        //营业概况的表格数据
        tableData2: [{
          startTime: '2017-12-03 13:55:49',
          endTime: '2017-12-04 08:37:51',
          cashier: '收银员1号',
          totalAmount: '6772.50',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          startTime: '2017-12-03 13:55:49',
          endTime: '2017-12-04 08:37:51',
          cashier: '收银员1号',
          totalAmount: '6772.50',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          startTime: '2017-12-03 13:55:49',
          endTime: '2017-12-04 08:37:51',
          cashier: '收银员1号',
          totalAmount: '6772.50',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          startTime: '2017-12-03 13:55:49',
          endTime: '2017-12-04 08:37:51',
          cashier: '收银员1号',
          totalAmount: '6772.50',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          startTime: '2017-12-03 13:55:49',
          endTime: '2017-12-04 08:37:51',
          cashier: '收银员1号',
          totalAmount: '6772.50',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }, {
          startTime: '2017-12-03 13:55:49',
          endTime: '2017-12-04 08:37:51',
          cashier: '收银员1号',
          totalAmount: '6772.50',
          payment1: '19077.00',
          payment2: '6772.50',
          payment3: '150.60',
          payment4: '0.00',
          payment5: '0.00',
          payment6: '0.00',
        }],
        //交接班的表格数据
        tableData3: [{
          operatingTime: '2017-12-03 13:55:49',
          cashier: '收银员1号',
          amount: '6772.50',
          incomeAndExpenses: '商品销售',
          remark: '0.00',
        }, {
          operatingTime: '2017-12-03 13:55:49',
          cashier: '收银员1号',
          amount: '6772.50',
          incomeAndExpenses: '商品销售',
          remark: '0.00',
        }, {
          operatingTime: '2017-12-03 13:55:49',
          cashier: '收银员1号',
          amount: '6772.50',
          incomeAndExpenses: '商品销售',
          remark: '0.00',
        }, {
          operatingTime: '2017-12-03 13:55:49',
          cashier: '收银员1号',
          amount: '6772.50',
          incomeAndExpenses: '商品销售',
          remark: '0.00',
        }, {
          operatingTime: '2017-12-03 13:55:49',
          cashier: '收银员1号',
          amount: '6772.50',
          incomeAndExpenses: '商品销售',
          remark: '0.00',
        }, {
          operatingTime: '2017-12-03 13:55:49',
          cashier: '收银员1号',
          amount: '6772.50',
          incomeAndExpenses: '商品销售',
          remark: '0.00',
        }]
        //现金收支明细的表格数据
      };
    },
    methods: {
      handleClick(tab, event) {
        console.log(tab, event);
      }
    }
  }

</script>
